﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Biz
{
    public class CartSession
    {

        //private static string  CartSessionKey = "CartSession";

        //public static bool IsCartExistInSession(HttpContextBase context)
        //{
        //    return context.Session[CartSessionKey] as Cart != null;
        //}
        //public static void AddToCartSession(HttpContextBase context, Product product, int quantity)
        //{
        //    Cart cart = GetCart(context);
        //    cart.AddToCart(product, quantity);
        //    context.Session[CartSessionKey] = cart;
        //}
        //public static void RemoveCartSession(HttpContextBase context, int id)
        //{
        //    Cart cart = GetCart(context);
        //    cart.RemoveFromCart(id);
        //    context.Session[CartSessionKey] = cart;
        //}

        //public static Cart GetCartFromSession(HttpContextBase context)
        //{
        //    return context.Session[CartSessionKey] as Cart;
        //}

        //public static Cart GetCart(HttpContextBase context)
        //{
        //    Cart cart = null;
        //    if (IsCartExistInSession(context))
        //    {
        //        cart = GetCartFromSession(context);
        //    }
        //    else
        //    {
        //        cart = new Cart();
        //    }
        //    return cart;
        //} 

       
    }
}